<template>
  <main class="friend-links-page" role="main">
    <div class="container">
      <div class="row justify-content-center">
        <div class="col-lg-10">
          <header class="page-header">
            <h1 class="page-title">友情链接</h1>
            <p class="page-subtitle">推荐优质的技术博客和网站，一起学习成长</p>
          </header>

          <section class="links-content">
            <div class="links-grid">
              <div class="link-card">
                <div class="link-icon">
                  <i class="fa fa-code" aria-hidden="true"></i>
                </div>
                <h3>技术博客</h3>
                <p>优质的个人技术博客</p>
                <a href="#" class="link-btn" target="_blank" rel="noopener noreferrer">访问</a>
              </div>

              <div class="link-card">
                <div class="link-icon">
                  <i class="fa fa-book" aria-hidden="true"></i>
                </div>
                <h3>学习资源</h3>
                <p>编程学习和教程网站</p>
                <a href="#" class="link-btn" target="_blank" rel="noopener noreferrer">访问</a>
              </div>

              <div class="link-card">
                <div class="link-icon">
                  <i class="fa fa-users" aria-hidden="true"></i>
                </div>
                <h3>开发社区</h3>
                <p>技术交流和讨论社区</p>
                <a href="#" class="link-btn" target="_blank" rel="noopener noreferrer">访问</a>
              </div>

              <div class="link-card">
                <div class="link-icon">
                  <i class="fa fa-tools" aria-hidden="true"></i>
                </div>
                <h3>开发工具</h3>
                <p>实用的开发工具和服务</p>
                <a href="#" class="link-btn" target="_blank" rel="noopener noreferrer">访问</a>
              </div>
            </div>

            <div class="apply-section">
              <h2>申请友链</h2>
              <div class="apply-card">
                <div class="apply-content">
                  <h3>友链要求</h3>
                  <ul class="requirements-list">
                    <li>网站内容健康，无违法违规信息</li>
                    <li>技术相关内容，有一定的原创性</li>
                    <li>网站稳定运行，访问速度良好</li>
                    <li>定期更新，保持活跃度</li>
                  </ul>
                  
                  <h3>申请方式</h3>
                  <p>
                    请通过邮件联系我们申请友链，邮件中请包含：
                  </p>
                  <ul class="apply-info">
                    <li>网站名称</li>
                    <li>网站地址</li>
                    <li>网站描述</li>
                    <li>联系方式</li>
                  </ul>
                  
                  <div class="contact-info">
                    <p>
                      <strong>联系邮箱：</strong>
                      <a href="mailto:903580396@qq.com">903580396@qq.com</a>
                    </p>
                  </div>
                </div>
              </div>
            </div>
          </section>
        </div>
      </div>
    </div>
  </main>
</template>

<script lang="ts" setup>
import { onMounted } from "vue";
import { setSEO } from "@/utils/seo";

// 设置友情链接页面SEO
onMounted(() => {
  setSEO({
    title: "友情链接",
    description: "数知笔记友情链接 - 推荐优质的技术博客和网站，包括技术博客、学习资源、开发社区和开发工具。欢迎申请友链交换。",
    keywords: "友情链接,技术博客,学习资源,开发社区,开发工具,友链申请",
    canonicalUrl: window.location.origin + "/friend_links",
  });
});
</script>

<style lang="scss" scoped>
.friend-links-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
  padding: 2rem 0;

  .page-header {
    text-align: center;
    margin-bottom: 3rem;

    .page-title {
      font-size: 2.5rem;
      font-weight: 700;
      color: #1e293b;
      margin-bottom: 1rem;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;

      @media (max-width: 768px) {
        font-size: 2rem;
      }
    }

    .page-subtitle {
      font-size: 1.125rem;
      color: #64748b;
      max-width: 600px;
      margin: 0 auto;
      line-height: 1.6;
    }
  }

  .links-content {
    .links-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
      gap: 2rem;
      margin-bottom: 4rem;

      .link-card {
        background: white;
        border-radius: 16px;
        padding: 2rem;
        text-align: center;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
        border: 1px solid rgba(226, 232, 240, 0.8);
        transition: all 0.3s ease;
        position: relative;
        overflow: hidden;

        &::before {
          content: '';
          position: absolute;
          top: 0;
          left: -100%;
          width: 100%;
          height: 100%;
          background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
          transition: left 0.5s;
        }

        &:hover {
          transform: translateY(-8px);
          box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);

          &::before {
            left: 100%;
          }

          .link-icon {
            transform: scale(1.1);
          }
        }

        .link-icon {
          width: 80px;
          height: 80px;
          background: linear-gradient(135deg, #667eea, #764ba2);
          border-radius: 20px;
          display: flex;
          align-items: center;
          justify-content: center;
          margin: 0 auto 1.5rem;
          transition: all 0.3s ease;

          i {
            font-size: 2rem;
            color: white;
          }
        }

        h3 {
          font-size: 1.25rem;
          font-weight: 600;
          color: #1e293b;
          margin-bottom: 0.75rem;
        }

        p {
          color: #64748b;
          margin-bottom: 1.5rem;
          line-height: 1.5;
        }

        .link-btn {
          display: inline-block;
          background: linear-gradient(135deg, #3b82f6, #1d4ed8);
          color: white;
          padding: 0.75rem 2rem;
          border-radius: 25px;
          text-decoration: none;
          font-weight: 600;
          transition: all 0.3s ease;

          &:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
            color: white;
          }
        }
      }
    }

    .apply-section {
      h2 {
        font-size: 2rem;
        font-weight: 600;
        color: #1e293b;
        text-align: center;
        margin-bottom: 2rem;
        position: relative;

        &::after {
          content: '';
          position: absolute;
          bottom: -0.75rem;
          left: 50%;
          transform: translateX(-50%);
          width: 80px;
          height: 3px;
          background: linear-gradient(90deg, #3b82f6, #8b5cf6);
          border-radius: 2px;
        }
      }

      .apply-card {
        background: white;
        border-radius: 16px;
        padding: 2.5rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
        border: 1px solid rgba(226, 232, 240, 0.8);

        @media (max-width: 768px) {
          padding: 1.5rem;
        }

        .apply-content {
          h3 {
            font-size: 1.5rem;
            font-weight: 600;
            color: #1e293b;
            margin-bottom: 1rem;
            padding-bottom: 0.5rem;
            border-bottom: 2px solid #e2e8f0;
          }

          .requirements-list,
          .apply-info {
            list-style: none;
            padding: 0;
            margin: 1.5rem 0;

            li {
              padding: 0.75rem 0;
              padding-left: 2rem;
              position: relative;
              color: #475569;
              line-height: 1.6;

              &::before {
                content: '✓';
                position: absolute;
                left: 0;
                color: #10b981;
                font-weight: bold;
                font-size: 1.1rem;
              }
            }
          }

          .apply-info li::before {
            content: '•';
            color: #3b82f6;
          }

          p {
            color: #475569;
            line-height: 1.7;
            margin: 1rem 0;
          }

          .contact-info {
            background: #f8fafc;
            border-radius: 12px;
            padding: 1.5rem;
            margin-top: 2rem;
            border-left: 4px solid #3b82f6;

            p {
              margin: 0;
              font-size: 1.1rem;
            }

            strong {
              color: #1e293b;
            }

            a {
              color: #3b82f6;
              text-decoration: none;
              font-weight: 500;
              transition: color 0.3s ease;

              &:hover {
                color: #1d4ed8;
                text-decoration: underline;
              }
            }
          }
        }
      }
    }
  }
}

// 深色模式适配
@media (prefers-color-scheme: dark) {
  .friend-links-page {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);

    .page-title {
      color: #f1f5f9;
    }

    .page-subtitle {
      color: #cbd5e1;
    }

    .link-card,
    .apply-card {
      background: #1e293b;
      border-color: #334155;

      h3 {
        color: #f1f5f9;
      }

      p {
        color: #cbd5e1;
      }
    }

    .apply-section h2 {
      color: #f1f5f9;
    }

    .apply-content {
      h3 {
        color: #f1f5f9;
        border-bottom-color: #475569;
      }

      .requirements-list li,
      .apply-info li,
      p {
        color: #cbd5e1;
      }

      .contact-info {
        background: #334155;
        border-left-color: #60a5fa;

        strong {
          color: #f1f5f9;
        }

        a {
          color: #60a5fa;

          &:hover {
            color: #93c5fd;
          }
        }
      }
    }
  }
}

// 高对比度模式
@media (prefers-contrast: high) {
  .friend-links-page {
    background: #ffffff;

    .page-title {
      background: none;
      -webkit-text-fill-color: initial;
      color: #000000;
    }

    .link-card,
    .apply-card {
      border: 2px solid #000000;
    }

    .link-btn {
      background: #000000;
    }
  }
}

// 无障碍支持
@media (prefers-reduced-motion: reduce) {
  .link-card:hover {
    transform: none !important;
  }
  
  .link-card::before {
    transition: none !important;
  }
  
  .link-icon {
    transition: none !important;
  }
  
  .link-btn:hover {
    transform: none !important;
  }
}
</style>
